<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
    <title>解答</title>
    <link rel="stylesheet" href="${ctxPath}/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="${ctxPath}/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="${ctxPath}/simditor/styles/simditor.css">
    <link rel="stylesheet" href="${ctxPath}/css/common.css">
    <link rel="stylesheet" href="${ctxPath}/css/topic.css">
    <link rel="stylesheet" href="${ctxPath}/css/jieda.css">
</head>
<body>
<jsp:include page="/WEB-INF/pages/commons/header.jsp"></jsp:include>

<%--面包屑导航条--%>
<nav class="list">
    <a href="${ctxPath}/index.jsp">首页</a>
    <i>/</i>
    <b>话题解答</b>
</nav>

<%--当前页面主要内容--%>
<main class="topic-detail-container">
    <div class="explain o">
        <div class="topic-title biaoti">${topic.title}</div>
        <div class="a">
            <div class="aa">
                <b>${topic.author.nickname}</b>
            </div>
            <div class="ab">
                <span ><b>${topic.author.nickname} </b></span>
                <span >发布时间 &nbsp;&nbsp;${topic.publishTime}</span>
            </div>
        </div>
        <div class="b ob">
            <b>${topic.content}</b>
        </div>
        <div class="c">
            <div class="cc"></div>
        </div>
    </div>
    <c:if test="${not empty sessionScope.customer}">
    <div class="editor-container">
        <form action="${ctxPath}/explain/publish" method="post">
            <input type="hidden" name="topicId" value="${topic.id}">
            <textarea name="content" id="editor">${content}</textarea>
            <div class="row buttons">
                <span class="col-2 offset-8 row justify-content-end">
                    <button type="reset" class="col-5 btn btn-primary btn-sm">重置</button>
                    <button type="submit" class="col-5 offset-1 btn btn-primary btn-sm">发布</button>
                </span>
            </div>
        </form>
    </div>
    </c:if>
</main>

<c:remove var="message" scope="session" />
<c:remove var="content" scope="session" />

<script type="text/javascript" src="${ctxPath}/simditor/scripts/jquery.min.js"></script>
<script type="text/javascript" src="${ctxPath}/simditor/scripts/module.js"></script>
<script type="text/javascript" src="${ctxPath}/simditor/scripts/uploader.js"></script>
<script type="text/javascript" src="${ctxPath}/simditor/scripts/hotkeys.js"></script>
<script type="text/javascript" src="${ctxPath}/simditor/scripts/dompurify.js"></script>
<script type="text/javascript" src="${ctxPath}/simditor/scripts/simditor.js"></script>
<script type="text/javascript" src="${ctxPath}/js/editor.js"></script>

<jsp:include page="/WEB-INF/pages/commons/footer.jsp"></jsp:include>
</body>
</html>
